package com.example.feigntest.service.serviceFallback;

import com.example.dto.User;
import com.example.feigntest.service.RefactorHelloService;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 继承了RefactorHelloService把requestMapping继承过来了，所以不能启动，会有ambiouns mapping错误。
 */
public class HelloServiceFallback2 implements RefactorHelloService {
    @Override
    public String hello(@RequestParam("name") String name) {
        return "error";
    }

    @Override
    public User hello(@RequestHeader("name") String name, @RequestHeader("password") String password) {
        return new User("未知","0");
    }

    @Override
    public String hello(@RequestBody User user) {
        return "error";
    }
}
